<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹窗功能测试</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .demo-container {
            background: white;
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 500px;
            width: 90%;
            position: relative;
        }

        .title {
            font-size: 28px;
            font-weight: 600;
            color: #333;
            margin-bottom: 20px;
        }

        .description {
            color: #666;
            margin-bottom: 30px;
            line-height: 1.6;
        }

        .demo-btn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 25px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            margin: 10px;
        }

        .demo-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        }

        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .popup-content {
            background: white;
            border-radius: 15px;
            padding: 30px;
            max-width: 400px;
            width: 90%;
            position: relative;
        }

        .popup-title {
            font-size: 24px;
            font-weight: 600;
            color: #333;
            margin-bottom: 20px;
            text-align: center;
        }

        .info-display {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .info-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        .info-item:last-child {
            margin-bottom: 0;
        }

        .info-label {
            font-size: 14px;
            color: #666;
            width: 80px;
            flex-shrink: 0;
        }

        .current-avatar {
            width: 50px;
            height: 50px;
            border-radius: 25px;
            border: 2px solid #e0e0e0;
            background: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }

        .current-nickname {
            font-size: 16px;
            color: #333;
        }

        .tip-text {
            font-size: 14px;
            color: #666;
            line-height: 1.6;
            margin-bottom: 25px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #52c41a;
        }

        .highlight-text {
            color: #52c41a;
            font-weight: 500;
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }

        .btn {
            height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            font-size: 14px;
            border: none;
            padding: 0 15px;
            cursor: pointer;
            transition: all 0.3s;
            flex: 1;
            font-weight: 500;
        }

        .avatar-btn {
            background: linear-gradient(135deg, #ff7875, #ff4d4f);
            color: white;
        }

        .nickname-btn {
            background: linear-gradient(135deg, #52c41a, #389e0d);
            color: white;
        }

        .close-btn {
            background: #f5f5f5;
            color: #666;
            width: 100%;
        }

        .btn:hover {
            opacity: 0.8;
        }

        .success-message {
            background: #f6ffed;
            border: 1px solid #b7eb8f;
            color: #52c41a;
            padding: 15px;
            border-radius: 8px;
            margin-top: 20px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="demo-container">
        <h1 class="title">🎯 弹窗功能测试</h1>
        <p class="description">
            弹窗已成功修改为分别获取头像和昵称的功能！<br>
            点击下方按钮查看新的弹窗效果。
        </p>

        <button class="demo-btn" onclick="showPopup()">
            🔧 显示弹窗
        </button>

        <div id="successMessage" class="success-message" style="display: none;">
            ✅ 弹窗组件修改成功！现在有两个独立的按钮：
            <br>• 红色按钮：获取头像
            <br>• 绿色按钮：获取昵称
        </div>
    </div>

    <!-- 弹窗 -->
    <div id="popupOverlay" class="popup-overlay" onclick="hidePopup()">
        <div class="popup-content" onclick="event.stopPropagation()">
            <div class="popup-title">获取头像跟昵称</div>
            
            <!-- 当前信息显示 -->
            <div class="info-display">
                <div class="info-item">
                    <span class="info-label">当前头像：</span>
                    <div class="current-avatar">头</div>
                </div>
                <div class="info-item">
                    <span class="info-label">当前昵称：</span>
                    <span class="current-nickname">匿名AJs87</span>
                </div>
            </div>
            
            <!-- 提示说明 -->
            <div class="tip-text">
                点击下方按钮可以分别获取头像和昵称信息。
                <span class="highlight-text"><br><br>🎯 操作说明：</span>
                <span class="highlight-text"><br>• 点击"获取头像"可以选择或更新头像</span>
                <span class="highlight-text"><br>• 点击"获取昵称"可以修改昵称信息</span>
                <span class="highlight-text"><br>• 微信环境下会使用微信原生组件</span>
                <br><br>也可以在个人中心页面直接点击头像或昵称区域进行修改。
            </div>
            
            <!-- 按钮区域 -->
            <div class="button-section">
                <div class="action-buttons">
                    <button class="btn avatar-btn" onclick="handleGetAvatar()">
                        📷 获取头像
                    </button>
                    <button class="btn nickname-btn" onclick="handleGetNickname()">
                        ✏️ 获取昵称
                    </button>
                </div>
                <button class="btn close-btn" onclick="hidePopup()">关闭</button>
            </div>
        </div>
    </div>

    <script>
        function showPopup() {
            document.getElementById('popupOverlay').style.display = 'flex';
            document.getElementById('successMessage').style.display = 'block';
        }

        function hidePopup() {
            document.getElementById('popupOverlay').style.display = 'none';
        }

        function handleGetAvatar() {
            alert('🎉 获取头像功能触发！\n\n在实际应用中，这里会：\n• 在微信环境下使用 chooseAvatar 组件\n• 在其他环境下打开相册选择图片\n• 上传头像到云存储\n• 更新用户资料');
        }

        function handleGetNickname() {
            alert('🎉 获取昵称功能触发！\n\n在实际应用中，这里会：\n• 在微信环境下使用昵称填写组件\n• 在其他环境下显示输入框\n• 更新用户昵称\n• 同步到云端数据库');
        }

        // 页面加载完成后显示成功消息
        window.onload = function() {
            setTimeout(() => {
                document.getElementById('successMessage').style.display = 'block';
            }, 1000);
        };
    </script>
</body>
</html>